#ifndef ELABSTRACTSHAPE_H
#define ELABSTRACTSHAPE_H
#include <QColor>

class ELAbstractShape
{
public:
    ELAbstractShape(bool ** tableState, QColor *** tableColors, int numBlockVertical, int numBlockHorizontal);
    virtual ~ELAbstractShape() {}
    virtual bool moveLeft() = 0;
    virtual bool moveRight() = 0;
    virtual bool moveDown() = 0;
    virtual bool rotate() = 0;
    virtual void moveToBottom() = 0;

    virtual bool canMoveLeft() = 0;
    virtual bool canMoveRight() = 0;
    virtual bool canMoveDown() = 0;
    virtual bool canRotate() = 0;

    virtual bool prepare() = 0;
    virtual void reset() = 0;
    virtual void setState(int newState) = 0;
    virtual void setLayout() = 0;
    virtual int height() = 0;
    virtual void setBlockColor(QColor newColor) { blockColor = newColor; }

    int * getLayout() { return layout;}
    int top() const { return top_; }
    int left() const { return left_; }
protected:
    // data memebers.
    int row, column;
    int left_, top_;
    bool ** hasBlock;
    int state;
    int layout[4]; // used for drawing next shape.
    int height_;
    QColor blockColor;
    QColor *** colors;
    //enum State {NORMAL, ROTATE90, ROTATE180, ROTATE270} state;

public:
    virtual void printTableState() = 0;
};

#endif // ELABSTRACTSHAPE_H
